home *** CD-ROM | disk | FTP | other *** search
/ Whiteline: delta / whiteline CD Series - delta.iso / tex / style / misc / named.sty < prev    next >
Text File  |  1995-11-25  |  2KB  |  54 lines

  1. % This file implements citations for the ``named'' bibliography style.
  2. %  Place it in a file called named.sty in the TeX search path.  (Placing it
  3. % in the same directory as the LaTeX document should also work.)
  4.  
  5. % The ``named'' bibliography style creates citations with labels like
  6. %    \citeauthoryear{author-info}{year}
  7. % these labels are processed by the following commands:
  8. %    \cite{key}
  9. %        which produces citations with both author and year,
  10. %        enclosed in square brackets
  11. %    \shortcite{key}
  12. %        which produces citations with year only,
  13. %        enclosed in square brackets
  14. %    \citeauthor{key}
  15. %        which produces the author information only
  16. %    \citeyear{key}
  17. %        which produces the year information only
  18.  
  19. \def\@up#1{\raise.2ex\hbox{#1}}
  20.  
  21. \let\@internalcite\cite
  22. \def\cite{\def\@citeseppen{-1000}%
  23.  \def\@cite##1##2{\@up[\nobreak\hskip 0in{##1\if@tempswa , ##2\fi}\@up]}%
  24.  \def\citeauthoryear##1##2{##1, ##2}\@internalcite}
  25. \def\shortcite{\def\@citeseppen{1000}%
  26.  \def\@cite##1##2{\@up[{##1\if@tempswa , ##2\fi}\@up]}%
  27.  \def\citeauthoryear##1##2{##2}\@internalcite}
  28.  
  29. \def\citeauthor#1{\def\@cite##1##2{{##1\if@tempswa , ##2\fi}}%
  30.  \def\citeauthoryear##1##2{##1}\@citedata{#1}}
  31. \def\citeyear#1{\def\@cite##1##2{{##1\if@tempswa , ##2\fi}}%
  32.  \def\citeauthoryear##1##2{##2}\@citedata{#1}}
  33.  
  34. \def\@citedata#1{\@tempswafalse%
  35.  \if@filesw\immediate\write\@auxout{\string\citation{#1}}\fi
  36.   \def\@citea{}\@cite{\@for\@citeb:=#1\do
  37.     {\@citea\def\@citea{,\penalty\@citeseppen\ }\@ifundefined
  38.        {b@\@citeb}{{\bf ?}\@warning
  39.        {Citation `\@citeb' on page \thepage \space undefined}}%
  40. {\csname b@\@citeb\endcsname}}}{}}
  41.  
  42. % don't box citations, separate with ; and a space
  43. % also, make the penalty between citations negative: a good place to break
  44. \def\@citex[#1]#2{\if@filesw\immediate\write\@auxout{\string\citation{#2}}\fi
  45.   \def\@citea{}\@cite{\@for\@citeb:=#2\do
  46.     {\@citea\def\@citea{,\penalty\@citeseppen\ }\@ifundefined
  47.        {b@\@citeb}{{\bf ?}\@warning
  48.        {Citation `\@citeb' on page \thepage \space undefined}}%
  49. {\csname b@\@citeb\endcsname}}}{#1}}
  50.  
  51. % raise the brackets in bibliography labels
  52. \def\@biblabel#1{\def\citeauthoryear##1##2{##1, ##2}%
  53.   \raise.2ex\hbox{[}#1\raise.2ex\hbox{]}\hfill}
  54.